<template>
	<view class="pageItem">
		<view class="content">
			<view class="user" v-for="(item,index) in list" @click="go(item.api_token)">
				<image class="user_img" src="../../static/order/list_21.png"></image>
				<view class="user_con">
					<view class="u_name">{{item.username}}</view>
					<view class="u_account">账号：{{item.name}}</view>
				</view>
				<view class="iconfont icon" :class="Token == item.api_token ? 'icon_select':''">&#xe626;</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				Token:'',
				list:[],
				select:1
			}
		},
		onShow(){
			this.Token=this.Net._getToken();
		    this.loadData()
		
		},
		methods: {
			loadData(){
					let me = this;
					
					me.Net._get('phoneList',{},(res)=>{
						if(res.code ==1){
						
									me.list=res.data
						}
					});
						},
			go(api_token){
				let me = this;
				        me.Token=api_token;
						me.Net._setToken(api_token);
						me.Msg.Success('切换成功',()=>{
							setTimeout(function(){
								uni.navigateBack()
							},500)
						})
					},
		}
	}
</script>

<style lang="scss">
.content{
	width: 100%;
	padding: 30rpx 4%;
	.user:not(:first-of-type){
		margin-top: 15rpx;
	}
	.user{
		width: 100%;
		padding: 30rpx;
		border-radius: 20rpx;
		background: #ffffff;
		display: flex;
		align-items: center;
		.user_img{
			width: 10vw;
			height: 10vw;
			padding: 10rpx;
			border-radius: 50%;
			background: #f9f9f9;
		}
		.user_con{
			flex: 1;
			padding-left: 20rpx;
			.u_name{
				font-size: 30rpx;
				font-weight: bold;
			}
			.u_account{
				padding-top: 10rpx;
				font-size: 26rpx;
				font-weight: bold;
			}
		}
		.icon{
			font-size: 40rpx;
			color: #e7e7e7;
		}
		.icon_select{
			color: #ffffff;
			background: #4d726f;
			border-radius: 50%;
		}
	}
}
</style>
